package com.yld.ch04;

import java.io.IOException;

public class Client {
	
	
	public static void main(String[] args) {
		
		
		Thread thread  = new Thread(new SleepThread());
		
		thread.start();
		
		
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e1) {
			//e1.printStackTrace();
		}
		System.out.println("线程将被挂起...");
		
		
		try {
			System.in.read();
		} catch (IOException e) {
			//e.printStackTrace();
		}
		
		//中断
		thread.interrupt();
	}

}



class SleepThread  implements Runnable{

	@Override
	public void run() {
		
		System.out.println("开始睡觉...");
		
		//睡眠1分钟然后起床看球赛
		
		try {
			Thread.sleep(10*1000);
		} catch (InterruptedException e) {
			//e.printStackTrace();
		}
		
		System.out.println("起床看足球赛....");
		
	}
	
	
}